<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新闻公告修改</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
</head>

<body>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <form action="__URL__/leavingMessingSave" method="post" class="form form-horizontal" id="form">
            <input type="hidden" name="id" value="{$msg.book_id}"/>
            <div class="form-group">
                <label class="col-sm-3 control-label">姓名：</label>
                <div class="col-sm-8" style="height:35px;line-height: 35px;">{$msg.book_name}</div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">电话：</label>
                <div class="col-sm-8" style="height:35px;line-height: 35px;">{$msg.book_phone}</div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">邮箱：</label>
                <div class="col-sm-8" style="height:35px;line-height: 35px;">{$msg.book_email}</div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">处理状态：</label>
                <div class="col-sm-8">
                    <select name="status" class="input-sm form-control input-s-sm inline">
                        <option value="1" <if condition="$msg.status eq 1">selected="selected"</if>>已处理</option>
                        <option value="2" <if condition="$msg.status neq 1">selected="selected"</if>>待处理</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">留言内容：</label>
                <div class="col-sm-8" style="height:35px;line-height: 35px;">{$msg.book_content}</div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea  name="remark" type="text/plain" style="width:100%;">{$msg.remark}</textarea>
                </div>
            </div>
            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                    <button type="button" class="btn btn-success radius" id="btn-save">
                        <i class="icon-ok"></i>保 存
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>
<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->

<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/common/js/layer_show.js"></script>
<!-- iCheck -->
<script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
<!-- Peity -->
<script>
    var index;
    $("#form").Validform({/*入金*/
        btnSubmit:"#btn-save",
        ajaxPost:true,
        tiptype: function(msg, o, cssctl) {
            //msg：提示信息;
            //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
            //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
            if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                var objtip = o.obj.parent().siblings(".Validform_checktip");
                cssctl(objtip, o.type);
                objtip.text(msg);
            }
        },beforeSubmit:function(curform){
            index = layer.load();
        },callback:function(data){
            layer.close(index);
            //alert(JSON.stringify(data));return;
            console.log(data);
            if(data.status==1){
                layer.msg(data.msg,{icon: 1, time: 2000});
                location.reload();
            }else if(data.status==0){
                layer.msg(data.msg,{icon: 2, time: 2000});
            }else{
                layer.msg('网络错误',{icon: 2, time: 2000});
            }
        }
    });
</script>
</body>
</html>
